package com.gome.oa;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.commons.io.IOUtils;

/**
 *
 * @author: tang li
 * @date: 2016年8月13日
 * @desc: 
 *
 */
public class HolidayManagement {
	
	private List<String> holidayList = new ArrayList<>();
	
	public HolidayManagement() {
		super();
		try {
			holidayList = IOUtils.readLines(HolidayManagement.class.getResourceAsStream("/com/gome/oa/holiday.txt"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public boolean isHoliday(Date date) {
		String d = new SimpleDateFormat("yyyy-MM-dd").format(date);
		return holidayList.contains(d);
	}

}
